<!DOCTYPE html>  
<html>
<head>  
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>设置点的新图标</title>  
<style type="text/css">  
  html{
    height:100%;
  }  
  body{
    height:100%;margin:0px;padding:0px;
  }  
  #container{
    height:100%;
  }  
</style>  
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DGr4upIYwrKhhf73RkQHMvhV2OW1NBXh"></script>
</head>  
<body>  
<div id="container"></div> 
<script type="text/javascript"> 
//获取当前自己位置处坐标
window.navigator.geolocation.watchPosition(success,error);
function success(position){

  //百度地图API功能 // 创建地图实例 
  var map = new BMap.Map("container");
  // 创建点坐标  
  var point = new BMap.Point(position.coords.longitude, position.coords.latitude);
  // 初始化地图，设置中心点坐标和地图级别  
  map.centerAndZoom(point, 15);

  //创建小狐狸
  var pt = new BMap.Point(116.417, 39.909);
  var myIcon = new BMap.Icon("http://lbsyun.baidu.com/jsdemo/img/fox.gif", new BMap.Size(300,157));
  var marker2 = new BMap.Marker(pt,{icon:myIcon});  // 创建标注
  map.addOverlay(marker2);   // 将标注添加到地图中
};
function error(error){
  alert('无法获取到位置信息')
};
</script>  
</body>  
</html>